Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Github-Projects integration & support for task weighting #1

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

markusheilig
Copy link

This PR contains two main features:

  1. Integration for Github-Projects
    You can visualize a Github-Projects board by configuring your github data via env-variables (see README.md) and append the http query parameter boardType=githubProjects to the url. In case the user decides to display a Github-Projects board, the header is also updated from "Data Visualisation Over Trello Board" to "Data Visualisation Over Github-Projects Board".

  2. Support for weighting tasks
    There are two ways to weight a task. The first one is by adding the label 'L' to a task in which case the task will be counted two times. The second one is by adding the label 'XL' to a task in which case the task will be counted three times. To enable task weighting you have to append the http query parameter weightTasks=true to the url.

Both changes do not affect any other existing behavior.

Copy link
Owner

@SengitU SengitU left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @markusheilig ,
Thanks for taking your time to make this project more generic. We can also change the name of the project if you like. (Company names should never be in the project's name anyways :) )
I left some comments, but they're mostly about the syntactic sugar, feel free merge this with or without applying the destructuring changes. As I said, they're just syntactic sugar.


const fetchAllIssues = () => {
const headers = createAuthorizedHttpHeader();
const issuesUrl = `${getGithubApiUrl()}/repos/mheilig/apprenticeship/issues`;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also recommend get this URL via environmental variable.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just realized, at the 6th commit or so you found a better way to do it! :)

return Promise.all([fetchAllIssues(), fetchDoneCards()])
.then((values) => {
const allIssues = values[0];
const doneCards = values[1];
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some shorthand notations you can use here. They are optional to use but in my opinion they make it easier to read. const [ allIssues, doneCards ] = values; will apply assign first element of the values to the allIssues and the second element to the doneCards.
You can also use this notation (note that this might be harder to see sometimes), .then(([ allIssues, doneCards ]) => {....

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check out destructuring in es6katas for more about this: http://es6katas.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants